from collections import Counter
import jieba

def word_counts(text:str):
    text = text.lower()
    # 分词
    words = jieba.lcut(text)
    # 统计并打印词频
    count_dict = {}
    for word, count in Counter(words).items():
        if word not in [' ', '.', '!', '?', '\n']:
            count_dict[word] = count
    print(count_dict)

# 文本列表
text_list = ["""Hello world!  
This is an example.  
Word count is fun.  
Is it fun to count words?  
Yes, it is fun!""", """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""]
# 执行逻辑
for text in text_list:
    word_counts(text)
    print('-'*20)